package com.xbh.mybatis_study.controller;


import com.xbh.mybatis_study.entity.Person;
import com.xbh.mybatis_study.mapper.PersonMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stu")
public class StuController {
    @Resource
    private PersonMapper personMapper;

    @GetMapping("test")
    public String addStu() {

        Person person = new Person().setAge(108).setName("彭祖");

        this.personMapper.insert(person);

        return "123";
    }
}
